#pragma once
#include <SDL.h>
#include "SDL_image.h"
#include "../log/Log.h"

#include "../model/Model.h"
#include "../model/StageParser.h"

#include "../commons/Constants.h"


class View {
private:
	// Ventana
	SDL_Window* window;
	// Superficie de la ventana
	SDL_Surface* screenSurface;
	// Estructura
	SDL_Renderer* renderer;

	// Limites de pantalla en pixeles
	int pixelWindowWidth;
	int pixelWindowHeight;

	float scaleX;
	float scaleY;


	bool View::initWindow();
	bool View::initRenderer();
	bool View::initPNGLoading();

public:
	View(void);

	bool View::createWindow(void);
	SDL_Texture* View::loadTexture(string path);
	SDL_Surface* View::loadSurface(string path);
	virtual bool loadMedia() { return true; }
	void View::close();
	virtual void View::update() {};

	void View::setMasterView(View* view);

	SDL_Window* View::getWindow();
	void View::setWindow(SDL_Window* window);

	SDL_Surface* View::getScreenSurface();
	void View::setScreenSurface(SDL_Surface* surface);

	SDL_Renderer* View::getRenderer();
	void View::setRenderer(SDL_Renderer* renderer);

	int View::getPixelWindowWidth();
	int View::getPixelWindowHeight();

	void View::setPixelWindowWidth(int pixelWindowWidth);
	void View::setPixelWindowHeight(int pixelWindowHeight);

	float getScaleX() { return this->scaleX; };
	float getScaleY() { return this->scaleY; };

	virtual ~View(void) {};
};